function shiJianCha(option){
  const targetTimeStr= option;
  const currentTime = new Date();
  const targetTime = new Date(targetTimeStr.replace(" ", "T"));
  const timeDiff = currentTime - targetTime;
  const days = Math.floor(timeDiff / (1000 * 60 * 60 * 24));
  const hours = Math.floor((timeDiff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  const minutes = Math.floor((timeDiff % (1000 * 60 * 60)) / (1000 * 60));
  const seconds = Math.floor((timeDiff % (1000 * 60)) / 1000);
  console.log(`时间差: ${days}天 ${hours}小时 ${minutes}分钟 ${seconds}秒`);
  let anser;
  if(days == 1){
    anser = "昨天";
  }else if(days > 30){
    anser = date2.getFullYear() + "-" + (date2.getMonth() + 1) + "-" + date2.getDate();
  }else if(days == 0){
    if(minutes != 0){
      anser = minutes + "分钟前";
    }else{
      anser = seconds + "秒前";
    }
  }else{
    anser = hours + "小时前"
  }
  return anser;
}

module.exports = {
  shiJianCha
}